// 测试地址
// var host = 'http://47.106.171.144:8082'
// const host = 'http://192.168.3.6:8084'
// 正式地址
// var host = 'http://180.10.10.50:8084'
// http://222.85.152.62

// var hostIp = 'http://222.85.156.70:8077'  // 正式环境
import axios from "axios";

// var hostIp = 'http://djhy.gov.cn:8077' // 正式环境域名版
var hostIp = 'https://www.gysdj.gov.cn:9201' //叶哥新提供的ip
// var hostIp = 'http://4uxad4.natappfree.cc' //xiongqi
// var hostIp = 'http://192.168.1.103:9200'
var oldHostIp = 'http://222.85.152.62:80'
var host = hostIp + '/party-center'
let smartPushApi = 'http://222.85.218.15:5048'
var testIp = ''
// if (window.android && window.android.getHost) {
//   host = window.android.getHost()
// }
let apiRet = {}
let api = {
  getToken: '/restApi/tokenController/getToken',
  getMyUserInfo: '/restApi/party/osUser/getMyUserInfo',
  editUserInfo: '/restApi/party/osUser/editUserInfo',
  updatePassword: '/restApi/party/osUser/updatePassword',
  getPartyMeetPlans: '/restApi/party/InsPartyPlan/getPartyMeetPlans',
  getAllCurrUserCreatePartyMeetingPage: '/restApi/party/partyMeetingRestController/getAllCurrUserCreatePartyMeetingPage',
  getPubsherMeetingInfoByPkId: '/restApi/party/partyMeetingRestController/getPubsherMeetingInfoByPkId/',
  startPartyMemberSign: '/restApi/party/partyMeetingRestController/startPartyMemberSign/',
  getPartyMemberBySmallGroupIds: '/restApi/party/partyMeetingRestController/getPartyMemberBySmallGroupIds',
  getPartyMembers: '/restApi/party/partyMember/getPartyMembers',
  appGetMeetingType: '/restApi/party/partyMeetingRestController/appGetMeetingType',
  saveAppInsPartyMeetingBean: '/restApi/party/partyMeetingRestController/saveAppInsPartyMeetingBean',
  getAllCurrUserAttendPartyMeetingPage: '/restApi/party/partyMeetingRestController/getAllCurrUserAttendPartyMeetingPage',
  endPartyMemberSign: '/restApi/party/partyMeetingRestController/endPartyMemberSign/',
  setSignUnUanually: '/restApi/party/partyMeetingRestController/setSignUnUanually',
  erweimaTest: '/restApi/party/partyMeetingRestController/erweimaTest',
  downLoadFile: '/restApi/sys/common/downLoadFile/',
  setPartyMemberRead: '/restApi/party/partyMeetingRestController/setPartyMemberRead',
  addPartyAffairs: '/restApi/partyAffairsRestController/addPartyAffairs',
  updFiles: '/restApi/sys/common/updFiles',
  getPartyAffairs: '/restApi/partyAffairsRestController/getPartyAffairs',
  partyMemberSign: '/restApi/party/partyMeetingRestController/partyMemberSign',
  appSaveDealContentAndFile: '/restApi/party/partyMeetingRestController/appSaveDealContentAndFile',
  getPartyMeetingAndPlanPage: '/restApi/party/partyMeetingRestController/getPartyMeetingAndPlanPage',
  eidtPartyAffairsInfo: '/restApi/partyAffairsRestController/eidtPartyAffairsInfo',
  delPartyAffairsById: '/restApi/partyAffairsRestController/delPartyAffairsById/',
  getPartyAffairsInfo: '/restApi/partyAffairsRestController/getPartyAffairsInfo',
  eidtInsPartyMeeting: '/restApi/party/partyMeetingRestController/eidtInsPartyMeeting',
  getSysNotice: '/restApi/noticeRestController/getSysNotice',
  getNewsCover: '/restApi/noticeRestController/getNewsCover',
  setMsgToRead: '/restApi/noticeRestController/setMsgToRead/',
  getPartyDynamicsInfoById: '/restApi/partyDynamicsRestController/getPartyDynamicsInfoById',
  getPartyDynamicsList: '/restApi/partyDynamicsRestController/getPartyDynamicsList',
  getPartyMemberListByStatusAndMeetingIdPage: '/restApi/party/partyMeetingRestController/getPartyMemberListByStatusAndMeetingIdPage',
  getPartyGroups: '/restApi/party/partyGroup/getPartyGroups',
  appSaveDiscussAndRecord: '/restApi/party/partyMeetingRestController/appSaveDiscussAndRecord',
  getStudyPlanByYear: '/restApi/exam/ins/studyPlanRestController/getStudyPlanByYear', // 某一年的学习计划
  getStudyPlanMonthAndWeekByMonthId: '/restApi/exam/ins/studyPlanRestController/getStudyPlanMonthAndWeekByMonthId',
  getStudyPlanWeekByWeekId: '/restApi/exam/ins/studyPlanRestController/getStudyPlanWeekByWeekId',
  getExamPaperAnswerDetail: '/restApi/exam/ins/examPaperRestController/getExamPaperAnswerDetail',
  getExamPaperList: '/restApi/exam/ins/examPaperRestController/getExamPaperList',
  getNotRelationMeetingList: '/restApi/exam/ins/studyPlanRestController/getNotRelationMeetingList', // 查询还没有被关联的集体学习会议
  saveAnswer: '/restApi/exam/ins/examPaperRestController/saveAnswer', // 提交答案
  setRelationMeetingToWeekPlan: '/restApi/exam/ins/studyPlanRestController/setRelationMeetingToWeekPlan', // 设置会议和周计划的关联关系（添加集体学习后/选择要关联的集体学习后）
  startAnswerByWeekPlanId: '/restApi/exam/ins/examPaperRestController/startAnswerByWeekPlanId', // 开始答题(根据周计划ID获取当前用户对应试卷的试题)
  partyMemberStudyStatistics: '/restApi/exam/ins/studyPlanRestController/partyMemberStudyStatistics', // 党务办查询党员学习统计
  getPartyGroupAnswerByYear: '/restApi/exam/ins/examReportRestController/getPartyGroupAnswerByYear', // 获取某党支部某年答题情况
  getPartyGroupAnswer: '/restApi/exam/ins/examReportRestController/getPartyGroupAnswer', // 获取某一党支部某月答题情况
  getPartyMemberAnswer: '/restApi/exam/ins/examReportRestController/getPartyMemberAnswer', // 获取某一党支部周计划中所有党员答题情况
  dwbPactchUpApprovaCount: '/restApi/exam/ins/studyPatchUpRestController/dwbPactchUpApprovaCount', // 审批的数量
  dwbPactchUpApprovalList: '/restApi/exam/ins/studyPatchUpRestController/dwbPactchUpApprovalList', // 党务办补开申请审批列表
  dwbPactchUpApproval: '/restApi/exam/ins/studyPatchUpRestController/dwbPactchUpApproval', //  补开审批
  dwbPactchUpHoveApprovalList: '/restApi/exam/ins/studyPatchUpRestController/dwbPactchUpHoveApprovalList', // 党务办已审批列表
  getNoAnswerRequestRecordList: '/restApi/exam/ins/examNoAnswerRequestRestController/getNoAnswerRequestRecordList', // 获取不答题申请的列表
  getPactUpDetails: '/restApi/exam/ins/studyPatchUpRestController/getPactUpDetails', // 集体学习会议超期补开详情
  getDetail: '/restApi/exam/ins/examNoAnswerRequestRestController/getDetail', // 获取不答题申请详情
  getPartyGroupAnswerByMonth: '/restApi/exam/ins/examReportRestController/getPartyGroupAnswerByMonth', // 获取各党支部某月答题情况
  submitExamNoAnswerRequest: '/restApi/exam/ins/examNoAnswerRequestRestController/submitExamNoAnswerRequest', // 提交不答题申请
  pactUpSubmit: '/restApi/exam/ins/studyPatchUpRestController/pactUpSubmit', // 补开提交
  getUserPayDetail: '/restApi/exam/ins/partyChargeReportRestController/getUserPayDetail', // 党员每月党费缴纳情况
  getPartyChargeReportByMonthAndPartyGroup: '/restApi/exam/ins/partyChargeReportRestController/getPartyChargeReportByMonthAndPartyGroup', // 某支部某月份党费缴纳情况
  getPartyGroupPayStatus: '/restApi/exam/ins/partyChargeReportRestController/getPartyGroupPayStatus', // 各支部某月份党费缴纳情况
  getChargeEndTime: '/restApi/exam/ins/partyChargeReportRestController/getChargeEndTime', // 获取党员缴费截止日期及剩余天数
  applyList: '/restApi/approvalApp/applyList', // 审批申请
  recordList: '/restApi/approvalApp/recordList', // 审批记录
  getInsPartyMeetingApprovalLogList: '/restApi/business/partyMeetingApprovalLogRestController/getInsPartyMeetingApprovalLogList', // 获取需要审批的组织生活会申请
  getPartyMeetingApprovalLogInfo: '/restApi/business/partyMeetingApprovalLogRestController/getPartyMeetingApprovalLogInfo', // 审批组织生活会详情
  saveApprovalLog: '/restApi/business/partyMeetingApprovalLogRestController/saveApprovalLog', // 保存组织生活会的审批
  dealWithExamNoAnswerRequest: '/restApi/exam/ins/examNoAnswerRequestRestController/dealWithExamNoAnswerRequest', // 处理不答题申请
  getPartyMember: '/restApi/party/partyMember/getPartyMember/', // 通过党员ID，查看党员信息
  getCheckRuleData: '/restApi/exam/ins/insIntegralConditionRestController/getCheckRuleData', // 考核规则
  getMoreDetails: '/restApi/exam/ins/insIntegralConditionRestController/getMoreDetails', // 支部及个人更多明细
  getOwnTenDetailsList: '/restApi/exam/ins/insIntegralConditionRestController/getOwnTenDetailsList', // 考支部及个人近期明细(10条)
  getOwnYearOrOwnGourp: '/restApi/exam/ins/insIntegralConditionRestController/getOwnYearOrOwnGourp', // 获取年度自己支部及自己考核排名查询
  rankingList: '/restApi/exam/ins/insIntegralConditionRestController/rankingList', // 支部及个人考核排名查询
  getPartyMemberAnswerInfo: '/restApi/exam/ins/examReportRestController/getPartyMemberAnswerInfo', // 个人学习答题信息
  // pointFindGroup: '/rest/partyAffairs/exam/pointFindGroup',//积分兑换补答题（已拆分为下面两个接口）
  pointConvertId: '/rest/partyAffairs/exam/pointConvertId',//积分兑换补答题获取ID
  pointConvertInfo: '/rest/partyAffairs/exam/pointConvertInfo',//积分兑换补答题学习内容
  savePointUserExam: '/rest/partyAffairs/exam/savePointUserExam', //兑换补答题提交学习问答
  sytxView: '/rest/partyAffairs/exam/sytxView', // (APP端)首页提醒信息查询
  sytpView: '/rest/partyAffairs/exam/sytpView', // (APP端)首页图片信息查询




  // 党建
  dzbOrgList: '/rest/partyAffairs/orgInfo/dzbOrgList', // 党支部列表
  participateList: '/rest/partyAffairs/orgLife/participate/list', // 我参与的组织生活会列表接口
  initiateList: '/rest/partyAffairs/orgLife/initiate/list', // 我发起的组织生活会列表接口
  orgLifeDetail: '/rest/partyAffairs/orgLife/orgLifeDetail', // 组织生活会详情接口
  orgLifeUpdateUndo: '/rest/partyAffairs/orgLife/updateUndo', // 2.66.	组织生活会取消
  myReceiveList: '/rest/partyAffairs/nodeMsg/myReceiveList', // 我接收到的通知列表接口
  delMsgMyReceive : '/api/tzgg/nodeMsg/result/delMsgMyReceive', // 通过通知ID和用户删除接收到的通知公告
  getUserResultInfo : '/api/tzgg/nodeMsg/result/getUserResultInfo', // 根据用户ID获取某个通知的接收反馈信息
  mySendList: '/rest/partyAffairs/nodeMsg/mySendList', // 我发送的通知列表接口
  findDzbUserList: '/rest/partyAffairs/orgUser/findDzbUserList', // 党支部所有党员
  findNextAllUserList: '/rest/partyAffairs/orgUser/findNextAllUserList', // 下级所有党员(限制100条)
  participateUserList: '/rest/partyAffairs/orgLife/participateUserList', // 会议参会人员列表接口
  optSaveOrgLife: '/rest/partyAffairs/orgLife/optSaveOrgLife', // 新增编辑组织生活会接口
  optSendNodeMsg: '/rest/partyAffairs/orgLife/optSendNodeMsg', // 新增确认会议通知(新增以后调用)
  durationList: '/rest/partyAffairs/orgLife/durationList', // 会议学习时长接口
  annexList: '/rest/partyAffairs/orgLife/annexList', // 会议附件列表接口
  prem: '/rest/partyAffairs/orgLife/initiate/prem', // 组织生活会发起权限接口
  sign: '/rest/partyAffairs/orgLife/sign', // 会议签到接口
  nodeMsgDetail: '/rest/partyAffairs/nodeMsg/nodeMsgDetail', // 通知详情接口
  complete: '/rest/partyAffairs/countTsaol/complete', // 主页三会一课达成率接口
  spaceInfoList: '/rest/partyAffairs/orgInfo/spaceInfoList', // 按类型查询党支部空间的信息
  saveSpaceInfoSupport: '/rest/partyAffairs/orgInfo/saveSpaceInfoSupport', // 2.59.	点赞支部空间信息
  saveSpaceInfoDelSpaceInfo: '/rest/partyAffairs/orgInfo/delSpaceInfo', // 2.63.	删除支部空间信息
  delSpaceInfoAnnex: '/rest/partyAffairs/orgInfo/delSpaceInfoAnnex', // 2.55.	删除支部空间信息附件资料
  updateSpaceSort: '/rest/partyAffairs/orgInfo/updateSpaceSort', // 2.62.	更新支部空间信息排序
  spaceInfoCommentList: '/rest/partyAffairs/orgInfo/spaceInfoCommentList', // 2.61.	支部空间信息评论列表
  saveSpaceInfoComment: '/rest/partyAffairs/orgInfo/saveSpaceInfoComment', // 2.60.	评论支部空间信息
  findWeekDiary: '/rest/partyAffairs/exam/findWeekDiary', // 查询一周一记
  weekDiaryView: '/rest/partyAffairs/exam/weekDiaryView', // 一周一记查看登记
  findGroup: '/rest/partyAffairs/exam/findGroup', // 查询学习问答内容
  saveUserExamData: '/rest/partyAffairs/exam/saveUserExamData', // 初始化用户学习问答
  findGroupTopicFlag: '/rest/partyAffairs/exam/findGroupTopicFlag', // 查询今日学习问答方式
  findGroupTopicFlagTest: '/rest/partyAffairs/exam/findGroupTopicFlagTest', // 查询今日学习问答方式
  saveGroupSubResult: '/rest/partyAffairs/exam/saveGroupSubResult', // 提交学习问答
  saveUserExam: '/rest/partyAffairs/exam/saveUserExam', // 提交用户出题
  findLatestLotteryResult: '/rest/partyAffairs/exam/findLatestLotteryResult', // 一周一记获奖名单展示
  optSaveOver: '/rest/partyAffairs/orgLife/optSaveOver', // 会议结束登记
  findDictList: '/rest/partyAffairs/partySys/findDictList', // 常量字典查询接口
  optSaveNodeMsg: '/rest/partyAffairs/nodeMsg/optNodeMsgFeedBack', // 反馈通知公告接口
  countMonthAchievement: '/rest/partyAffairs/exam/countMonthAchievement', // 支部月度成绩单
  getOrgInfoByUser: '/rest/partyAffairs/orgInfo/createOrgInfoByUser', // 查询支部的基本信息
  spaceInfoDetail: '/rest/partyAffairs/orgInfo/spaceInfoDetail', // 查询党支部空间的信息详情
  nodeMsgList: '/rest/partyAffairs/orgLife/nodeMsgList', // 查询会议通知接收人员列表
  signCode: '/rest/partyAffairs/orgLife/signCode', // 签到二维码
  findHints: '/rest/partyAffairs/exam/findHints', // 查询提示
  userDtlInfo: '/rest/partyAffairs/exam/userDtlInfo', // 查询用户答题率信息
  optNodeMsgRead: '/rest/partyAffairs/nodeMsg/optNodeMsgRead', // 设置通知已读接口
  optSaveOrgLifeV2: '/rest/partyAffairs/orgLife/optSaveOrgLifeV2', // 新增编辑组织生活会接口V2
  nodeMsgPrem: '/rest/partyAffairs/nodeMsg/prem', // 通知公告权限接口
  nodeMsgPrem2: '/rest/partyAffairs/nodeMsg/userPrem', // 通知公告权限接口
  branchNodeList: '/rest/partyAffairs/orgInfo/nodeList', // 查询党支部通知列表
  branchNodeDetail: '/rest/partyAffairs/orgInfo/nodeDetail', // 查询党支部通知详情
  findUserQuestion: '/rest/partyAffairs/exam/findUserQuestion', // 查询是否已出题
  readSpaceInfoStatusList: '/rest/partyAffairs/orgInfo/readSpaceInfoStatusList', // 查询支部空间模块未读消息数
  saveSpaceInfo: '/rest/partyAffairs/orgInfo/saveSpaceInfo', // 新增编辑支部空间的内容
  saveSpaceInfoRead: '/rest/partyAffairs/orgInfo/saveSpaceInfoRead', // 设置支部空间信息为已读
  optSaveNodeMsgAdd: '/rest/partyAffairs/nodeMsg/optSaveNodeMsg', // 新增编辑通知公告接口
  findNextOrgUserList: '/rest/partyAffairs/orgUser/findNextOrgUserList', // 查询下级党组织管理用户
  saveOrgInfoExt: '/rest/partyAffairs/orgInfo/saveOrgInfoExt', // 编辑党支部的基础信息接口
  partyPrem: '/rest/partyAffairs/partySys/partyPrem', // 党务模块权限
  hjtxInfo: '/rest/partyAffairs/orgInfo/hjtxInfo', // 换届提醒信息
  manualSign: '/rest/partyAffairs/orgLife/manualSign', // 会议手动补签接口
  assignUserList: '/rest/partyAffairs/nodeMsg/assignUserList', // 通知接收用户列表接口
  countUnRead: '/rest/partyAffairs/nodeMsg/countUnRead', // 通知公告未读数
  verifySignInRate: '/rest/partyAffairs/orgLife/verifySignInRate', // 验证会议签到率接口
  optResult: '/rest/partyAffairs/nodeMsg/optResult', // 查询通知的读取反馈情况
  // updateNodeMsgDel: '/rest/partyAffairs/nodeMsg/updateNodeMsgDel', // 删除通知公告接口(迁移以前)
  updateNodeMsgDel: '/rest/partyAffairs/nodeMsg/delNodeMsg/', // 删除通知公告接口（新服务器）
  getBdtFirstMonth: '/rest/partyAffairs/exam/getBdtFirstMonth',//获取最早的未答题的月份
  getLatelyWeiDaMonth: '/api/exam/bdt/getLatelyWeiDaMonth',//获取最近未答题的月份
  orderForMonthDtCalendar: '/rest/partyAffairs/exam/orderForMonthDtCalendar',//订单选择答题日历
  orderApplyGetDtInfo: '/rest/partyAffairs/exam/orderApplyGetDtInfo',//订单选择日期答题
  saveOrderApplyDt: '/rest/partyAffairs/exam/saveOrderApplyDt', //订单提交答题消费
  examQuestionList: '/api/exam/topic/userList', //根据用户获取出题列表
  examUserTopicMonthCalendar: '/api/exam/topic/userTopicMonthCalendar', // (题目)用户出题日历数据
  examUserTopicDetail: '/api/exam/topic/userTopicDetail/', // ((题目)查询用户出题详情

  meet_optAddAnnex: '/api/zzshh/meet/annex/optAddAnnex',//组织生活会改版-会议附件资料添加
  meet_optDelAnnex: '/api/zzshh/meet/annex/optDelAnnex',//组织生活会改版-会议附件资料删除
  meet_delay: '/api/zzshh/meet/delay',//组织生活会改版-会议推迟
  meet_delete: '/api/zzshh/meet/delete',//组织生活会改版-删除会议
  meet_doneList: '/api/zzshh/meet/doneList',//组织生活会改版-已办列表
  meet_edit: '/api/zzshh/meet/edit',//组织生活会改版-编辑会议内容及附件
  meet_launch: '/api/zzshh/meet/launch',//组织生活会改版-发起会议
  meet_optSaveOver: '/api/zzshh/meet/optSaveOver',//组织生活会改版-登记结束会议
  meet_todoList: '/api/zzshh/meet/todoList',//组织生活会改版-待办列表
  meet_updateUndo: '/api/zzshh/meet/updateUndo',//组织生活会改版-取消会议
  meet_addParticipateUser: '/api/zzshh/meet/user/addParticipateUser',//组织生活会改版-添加会议参会人员
  meet_delParticipateUser: '/api/zzshh/meet/user/delParticipateUser',//组织生活会改版-删除会议参会人员
  meet_getAddList: '/api/zzshh/meet/user/getAddList',//组织生活会改版-获取可添加的会议人员
  meet_manualSign: '/api/zzshh/meet/user/manualSign',//组织生活会改版-手动补签到
  meet_sign: '/api/zzshh/meet/user/sign',//组织生活会改版-扫码签到
  meet_getMeetIdByMsgId: '/api/zzshh/meet/getMeetIdByMsgId',//组织生活会改版-通过通知ID获取会议ID
  meet_selfListOfGroupId: '/api/zzshh/meet/selfListOfGroupId',//组织生活会改版-通过通知ID获取会议ID
  //支部空间改版
  topic_launch: '/api/zbkj/jiaoliu/saveOrEdit',//(交流)根据当前用户发起话题
  topic_selectListByUserOrg: '/api/zbkj/jiaoliu/listByUserOrg',//(交流)根据当前用户查询交流话题列表
  topic_addXdByTopic: '/api/zbkj/jiaoliuxd/addXd',//(交流)添加某个交流话题的心得
  topic_selectCommentListByXd: '/api/zbkj/jiaoliuxd/pldz/plList',//(交流)根据心得查询评论列表
  topic_subComment: '/api/zbkj/jiaoliuxd/pldz/subComment',//(交流)评论或回复某个心得
  topic_subSupport: '/api/zbkj/jiaoliuxd/pldz/subSupport',//(交流)点赞某个心得或评论
  topic_cancelSupport: '/api/zbkj/jiaoliuxd/pldz/cancelSupport',//(交流)取消点赞某个心得或评论
  topic_selectListByTopic: '/api/zbkj/jiaoliuxd/list',//(交流)根据交流话题查询心得列表
  topic_shareToZl: '/api/zbkj/zl/shareToZl',//(资料)分享到支部空间资料
  topic_delXdOpt: '/api/zbkj/jiaoliuxd/pldz/delXdOpt/',//(交流)删除心得的评论
  topic_delTopic: '/api/zbkj/jiaoliu/delTopic/',//(交流)删除某个话题
  topic_delXd: '/api/zbkj/jiaoliuxd/delXd/',//(交流)删除某个心得
  topic_getByType: '/api/zbkj/power/getByType',//根据用户获取操作权限
  topic_commentList: '/api/zbkj/optLog/commentList',//支部空间信息-评论列表
  topic_commentListByLog: '/api/zbkj/optLog/commentListByLog',//支部空间信息-评论的交互评论列表
  topic_opt_subSupport: '/api/zbkj/optLog/subSupport',//支部空间信息-点赞评论
  topic_saveComment: '/api/zbkj/optLog/saveComment',//支部空间信息-保存评论
  topic_saveCommentByLog: '/api/zbkj/optLog/saveCommentByLog',//支部空间信息-保存评论的交互评论
  topic_commentDelete: '/api/zbkj/optLog/delete',//支部空间信息-删除评论

  //党工委完成率排名
  dgwRank: '/api/zzshh/count/completionRate/dgwRank',//会议完成率-党工委完成率排名
  zzshpmQx: '/rest/partyAffairs/exam/zzshpmQx',//组织生活排名查看权限

  //通知公告app首页显示信息查询
  tzggAppShowView: '/rest/partyAffairs/nodeMsg/tzggAppShowView',//通知公告app首页显示信息查询


}

let gatewayApi = {
  userAvatar: '/api-file/sysFile/file/photo/',
  token: '/api-auth/oauth/user/tokenNew',
  refreshToken: '/api-auth/oauth/refresh/tokenNew', // 刷新token
  appCache: '/api-auth/redis/appAIP/cache/', // 页面是否缓存
  getCommonInfo: '/api-auth/redis/getCommonInfo', // 返回服务端公用配置信息
  userinfo: '/api-auth/oauth/userinfo',
  // birthday: '/api-user/userExt/party/birthday/',
  birthday: '/api-user/userExt/partyNew/birthday/',
  // partyQueryList: '/api-user/groupExt/party/queryList', // 查询党组织
  partyQueryList: '/api-user/groupExt/partyNew/queryList', // 查询党组织
  partyQueryById: '/api-user/groupExt/partyNew/', // 通过组织ID查看党组织信息NEW
  getOsGroupPageByPathNew: '/api-user/djsjk/toout/getOsGroupPageByPathNew', // 根据path获取部门权限(分页)

  childChannels: '/cms/channel/childChannels',
  channel: '/cms/channel/',
  contentPage: '/cms/news/content/page',//获取内容分页数据
  recommendPage: '/cms/news/recommend/page',//红云头条》推荐栏目 接口 20201111修改
  contentDetailNew: '/cms/news/content/detail/', //获取内容详情(新接口）
  deleteNews: '/cms/news/content/deleteMultiple', //删除新闻内容（多选）
  newsFiles: '/cms/news/file/', //获取新闻附件
  contentGetSortNo: '/cms/news/content/getSortNo',
  contentHistory: '/cms/news/content/history/',
  contentCarousel: '/cms/news/content/carousel/',
  contentGetSfdz: '/cms/news/content/getSfdz/', // 查询当前用户是否点赞指定的新闻
  contentGetSfsc: '/cms/news/content/getSfsc/', // 查询当前用户是否收藏指定的新闻
  currentChannel: '/cms/channel/appCurrentChannel', // app获取当前栏目级下的栏目
  indexMiddle: '/cms/news/content/indexMiddle', // 首页中部小视频(APP)
  contentPageDetail: '/cms/news/content/',
  // observationQuery: '/cms/back/groupWork/news/query',//线上观摩
  observationQuery: '/cms/app/groupWork/news/query',//线上观摩(app新）
  bannerQuery: '/cms/banner/query',
  commentAdd: '/cms/news/comment/add', // 添加新闻评论
  upsOrDownsPage: '/cms/news/comment/upsOrDownsPage', // 获取评论点赞点踩分页数据
  commentPage: '/cms/news/comment/page', // 获取评论分页数据
  upsAndDowns: '/cms/news/comment/upsAndDowns', // 评论的点赞或点踩
  commentGetSfdz: '/cms/news/comment/getSfdz/', // 获取评论是否被点赞
  newsUpsAndDowns: '/cms/news/content/upsAndDowns', // 内容的点赞或点踩
  cancelUpsAndDowns: '/cms/news/content/cancelUpsAndDowns', // 取消内容的点赞或点踩
  createUploadVideo: '/cms/vod/createUploadVideo', // 获取视频上传地址和凭证
  refreshUploadVideo: '/cms/vod/refreshUploadVideo', // 刷新视频上传凭证
  //支部荣誉
  honor_addOrUpdate: '/cms/app/partyGroup/honor/addOrUpdate',  //支部荣誉新增、修改
  honor_deleteMultiple: '/cms/app/partyGroup/honor/deleteMultiple',//支部荣誉删除
  honor_query: '/cms/app/partyGroup/honor/query',//支部荣誉列表

  o_upload: '/api-file/sysFile/upload/o_upload', // 上传文件
  download: '/api-file/sysFile/download/', // 下载文件
  trainingplanEvaluationCriterion: '/com-tj-gbzx/gbzx/trainingplanEvaluationCriterion/findList',
  findPjOfGr: '/com-tj-gbzx/gbzx/trainingplanpj/findPjOfGr', // 学员评价总结列表（显示登录人员已完成，待完成的评价列表）
  findCountOfJsjkc: '/com-tj-gbzx/gbzx/TrainingplanTj/findCountOfJsjkc', // 统计对教师及所授课程的评价
  findCountOfPxjg: '/com-tj-gbzx/gbzx/TrainingplanTj/findCountOfPxjg', // 统计对培训机构的评价
  findCountOfXy: '/com-tj-gbzx/gbzx/TrainingplanTj/findCountOfXy', // 统计对学员的评价(type 4培训机构对学员的评价 5主办单位对学员的评价)
  findCountOfZbdw: '/com-tj-gbzx/gbzx/TrainingplanTj/findCountOfZbdw', // 统计对主办单位的评价
  trainingplanClassList: '/com-tj-gbzx/gbzx/trainingplanClass/list',
  trainingplanClassSelectAll: '/com-tj-gbzx/gbzx/trainingplanClass/selectAll',
  trainingPlanInfoList: '/com-tj-gbzx/gbzx/trainingPlanInfo/list',
  trainingPlanInfoSaveOrUpdate: '/com-tj-gbzx/gbzx/trainingPlanInfo/saveOrUpdate',
  classList: '/com-tj-gbzx/gbzx/trainingplanCurriculum/list',
  trainingplanpjSaveOrUpdateOfAll: '/com-tj-gbzx/gbzx/trainingplanpj/saveOrUpdateOfAll',
  trainingplanInfoLogSaveOrUpdateOfAll: '/com-tj-gbzx/gbzx/trainingplanInfoLog/saveOrUpdate',
  countXs: '/com-tj-gbzx/gbzx/TrainingplanTj/countXs',
  findClassHoursList: '/com-tj-gbzx/gbzx/classHours/findClassHoursList',
  getDzdaByUserId: '/com-tj-gbzx/gbzx/TrainingplanTj/getDzdaByUserId',
  trainingplanpjList: '/com-tj-gbzx/gbzx/trainingplanpj/list',
  trainingPlanInfo: '/com-tj-gbzx/gbzx/trainingPlanInfo/selectAll',
  trainingplanClassSave: '/com-tj-gbzx/gbzx/trainingplanClass/saveOrUpdate', // 培训班新增或更新
  TrainingplanUserContactSave: '/com-tj-gbzx/gbzx/TrainingplanUserContact/saveOrUpdateOfAll', // 培训班参与人员批量保存
  trainingplanCurriculumSave: '/com-tj-gbzx/gbzx/trainingplanCurriculum/saveOrUpdateOfAll', // 培训班关联的课程表批量保存
  trainingplanClassUpdateById: '/com-tj-gbzx/gbzx/trainingplanClass/updateById', // 培训班根据主键id修改不为空的字段
  groupQueryList: '/api-user/group/queryList', // 获取培训机构
  usersQueryList: '/api-user/users/queryList', // 获取教师
  getUserInfo: '/api-user/users/', // 根据用户ID查询用户基本信息
  photo: '/api-user/users/photo', // 修改头像
  homeActivationInfo: '/api-user/activation/info', // 今日登录人数
  myCollectionPage: '/cms/news/favourite/page', // 我的收藏获取分页数据
  deleteMultiple: '/cms/news/favourite/deleteMultiple', // 删除我的收藏（多选）
  browseHistoryPage: '/cms/news/history/page', // 获取我的足迹分页数据
  browseHistoryDeleteMultiple: '/cms/news/history/deleteMultiple', // 删除我的足迹（多选）
  commentDeleteMultiple: '/cms/news/comment/deleteMultiple', // 删除新闻评论（多选）
  commentDeleteCommentByNews: '/cms/news/comment/commentInfo/', // 删除二级评论
  addOrUpdate: '/cms/news/content/addOrUpdate',
  updateCount: '/cms/news/content/updateCount',
  smallVideoOwn: '/cms/news/smallVideo/own', // 获取我发布的小视频分页数据
  smallVideoMyDianZan: '/cms/news/smallVideo/myDianZan', // 获取我发布的小视频分页数据
  smallVideoWatch: '/cms/news/smallVideo/watch/', // 获取我发布的小视频分页数据
  smallVideoCancelWatch: '/cms/news/smallVideo/cancelWatch/', // 取消对某个用户的关注
  getUserWarning: '/cms/back/news/comment/warning/getWarning/', //获取对用户的警告信息
  suggestAdd: '/api-friend/suggest/add',
  userInfo: '/api-user/users/current', // 根据access_token当前登录用户
  loginNew: '/api-user/users-anon/loginNew', // 根据用户名查询用户-标准
  loginCount: '/api-user/users/loginCount', // 查询当前登录用户登录次数
  // partyInfo: '/api-user/userExt/party/', // 根据用户id查看党员信息
  partyInfo: '/api-user/userExt/partyNew/', // 根据用户id查看党员信息
  sysFile: '/file-center/sysFile/', // 查看上传的文件
  sysFileSave: '/api-file/sysFile/save', // 添加文件记录
  friends: '/api-friend/friend/friends', // 获取我的好友列表
  friendNews: '/api-friend/action/friendNews', // 获取动态列表
  friendNewsDelete: '/api-friend/action/deleteFriendNews', // 删除动态
  releaseNews: '/api-friend/action/postFriendNews', // 用户发布动态
  friendApply: '/api-friend/friend/friendApply', // 好友申请
  friendComment: '/api-friend/action/friendComment', // 动态评论
  friendCommentDelete: '/api-friend/action/deleteFriendComment', // 删除动态评论
  groupInfoNes: '/api-friend/group/groupInfoNes',
  catalogInfoByGroupId: '/api-friend/catalog/catalogInfoByGroupId',
  groupInfoById: '/api-friend/group/groupInfo/',
  groupInfoContentInfo: '/api-friend/content/contentInfo/',
  groupInfoContentInfoViews: '/api-friend/content/contentInfo/views',
  groupInfoCommentInfo: '/api-friend/content/commentInfo',
  groupInfoCommentInfoPage: '/api-friend/content/commentInfo/page',//组工信息文章评论分页查询
  groupInfoCommentInfoUps: '/api-friend/content/commentInfo/ups',//增加组工信息文章评论的点赞
  groupInfoContentInfoUps: '/api-friend/content/contentInfo/ups',//增加组工信息文章内容点赞
  groupInfoCommentInfoDelete: '/api-friend/content/commentInfo/',
  groupInfoUps: '/api-friend/content/contentInfo/ups',
  groupInfoClick: '/api-friend/group/groupInfo/click/',
  honorAllInfos: '/api-friend/honor/honorInfo', // app查看自己的荣誉信息（全部荣誉已拥有和未拥有）
  honorInfo: '/api-friend/honor/honorInfo', // app用户上传自己的荣誉资料
  deleteHonor: '/api-friend/honor/deleteHonor/',//删除个人荣誉资料
  shareFriendNews: '/api-friend/share/friendNews', // 获取互动分享列表
  shareFriendAdd: '/api-friend/share/friendNews', // 用户发布互动分享
  shareFriendComment: '/api-friend/share/friendComment', // 互动分享评论
  actionFriendShare: '/api-friend/action/actionFriendShare', // 互动分享评论
  groupInfoYear: '/api-friend/group/groupInfoYear/', // 通过年获得组工信息
  pageForBack: '/cms/news/content/pageForBack', // 获取内容分页数据(后台系统)
  contentDetail: '/cms/news/content/', // 获取内容详情
  notifyDetail: '/cms/app/common/push/getDetail/', //获取更新通知内容详情
  userDept: '/cms/channel/userDept', // 获取当前用户订阅的部门信息
  userChannelDeptOne: '/cms/channel/userChannelDeptOne', // 当前用户添加订阅部门的信息（单个部门）
  deleteUserChannelDeptOne: '/cms/channel/deleteUserChannelDeptOne', // 当前用户取消订阅部门的信息（单个部门）
  getPersonSysHonor: '/cms/app/common/sys/honor/getPersonSysHonor', // 获取个人系统荣誉
  queryList: '/api-user/groupExt/zcbm/queryList', // 查询驻村部门
  coachSuggest: '/api-friend/coach/coachSuggest', // 用户提问
  coachSuggestList: '/api-friend/coach/coachSuggestList', // 查询驻村辅导列表
  coachSuggestListOwn: '/api-friend/coach/coachSuggestListOwn', // 我的问答列表
  passwords: '/api-user/users/password', // 修改密码
  getMyApplyList: '/api-friend/friend/getMyApplyList', // 获取我的申请好友列表
  getIsFriend: '/api-friend/friend/getIsFriend', // 判断红友是否是当前登录人的好友
  getFrindsApplyList: '/api-friend/friend/getFrindsApplyList', // 获取好友的申请我的列表
  getCocachSuggestInfo: '/api-friend/coach/getCocachSuggestInfo/', // 根据辅导id获取驻村辅导详情
  replayComment: '/api-friend/coach/replayComment', // 评价回复内容
  replayContext: '/api-friend/coach/replayContext', // 回复驻村辅导的提问
  getFriendComment: '/api-friend/action/friendComment', // 获取动态的文字评论列表
  agreeApply: '/api-friend/friend/agreeApply', // 同意好友申请
  friendApplyPut: '/api-friend/friend/putFriendApply', // 好友申请回复
  deletefriend: '/api-friend/friend/delete/', // 好友删除
  coachTeacherInfo: '/api-friend/coach/coachTeacherInfo', // 查看辅导师的满意率（coachTeacherId，则是这个部门下辅导师的满意率信息）
  coachTeacherSuggest: '/api-friend/coach/coachTeacherSuggest', // 获取该辅导师的问题
  addCollection: '/cms/news/favourite/add', // 添加到我的收藏
  coachSuggestNum: '/api-friend/coach/coachSuggestNum/', // 点击修改加一
  coachDeptInfo: '/api-friend/coach/coachDeptInfo', // 查看部门的满意率
  currentNew: '/api-user/users/currentNew', // 根据access_token获取当前登录用户信息-标准
  user_saveOrUpdate: '/api-user/djsjk/osUser/saveOrUpdate', // 新增修改党员信息
  user_rdsjUpdate: '/api-user/djsjk/osUser/rdsjUpdate', // 修改党员入党时间
  historyAdd: '/cms/news/history/add', // 添加到我的足迹
  modifyMobile: '/api-user/users/me', // 修改自己的个人信息
  listInterestedUser: '/cms/news/smallVideo/listInterestedUser', // 获取某用户关注的用户(userId不传则获取当前用户)
  deleteMyVideo: '/cms/news/smallVideo/delete/', // 删除我的小视频
  fmPage: '/cms/news/fm/page', // 获取分页数据(先查询专题栏目，如果栏目最后一页数据小于pageSize，则会返回音频的第一页，专题显示完后，再依次显示音频)
  cancelWatch: '/cms/news/smallVideo/cancelWatch/', // 取消对某个用户的关注
  selectAllList: '/com-tj-gbzx/gbzx/trainingPlanInfo/selectAllList', // 查询培训计划列表并查询计划相关的所有信息
  modifyNickName: '/api-user/users/nickName', // 修改用户昵称
  trainingplanLeave: '/com-tj-gbzx/gbzx/trainingplanLeave/list', // 请假旷课
  currentDeptUserPage: '/cms/channel/currentDeptUserPage', // 查询自己订阅的部门（包括未订阅和已订阅的）
  dictValue: '/api-core/systemCat/dictValue', // 根据分类key 树key 字典key 获取字典内容
  myIntegral: '/api-core/points/result/', // 查询用户积分
  dayDetailList: '/api-core/points/dayDetail/list', // 查询日积分明细
  detailList: '/api-core/points/detail/list', // 查询积分明细
  subDetail: '/api-core/points/subDetail/list',//查询积分兑换明细
  getCurrentUserInfoNum: '/api-core/innerMsg/getCurrentUserInfoNum', // 获取当前用户的未读消息条数
  pageMsg:'/api-core/innerMsg/pageMsg', // 消息内容分页列表获取
  innerMsg: '/api-core/innerMsg/delete/', // 删除内部消息
  updateBox: '/api-core/innerMsg/updateBox', // 更新用户消息接口
  updateReadByBusinessId: '/api-core/innerMsg/updateReadByBusinessId',//根据业务编码修改是否已读(或删除)
  appIndexSearch: '/cms/news/content/appIndexSearch', // 首页搜索
  watchVideo: '/cms/news/content/watchVideo',
  watchVideoTime: '/cms/news/content/watchVideoTime',
  contentRead: '/cms/news/content/read',
  studyTime: '/cms/news/content/studyTime',
  honorInfoOwn: '/api-friend/honor/honorInfoOwn', // 查看自己个人的荣誉信息分页
  bigVideoPage: '/cms/news/bigVideo/page', // 获取分页数据(先查询专题栏目，如果栏目最后一页数据小于pageSize，则会返回普通视频的第一页，专题显示完后，再依次显示普通视频)
  getUserInfoById: '/api-user/users/new/', // 根据用户ID查询用户基本信息-标准
  suggestQueryList: '/api-friend/suggest/queryList', // 查询我的反馈
  linkShare: '/api-friend/action/linkShare', // 外部链接分享
  sendCode: '/api-auth/oauth/sms/sendCode/', // 发送短信验证码
  checkCode: '/api-auth/oauth/sms/match/code', // 校验验证码
  updatePassWordByPhone: '/api-auth/oauth/user/updatePassWordByPhone', // 短信验证码重置用户密码
  findZbdwPjOfApp: '/com-tj-gbzx/gbzx/trainingplanClass/findZbdwPjOfApp', // app查询主办单位待评价和已评价的培训班
  suggestByid: '/api-friend/suggest/', // 根据ID返回问题建议
  dangWuPage: '/cms/news/app/dangWu/page', // 获取内容分页数据(可按字段排序)
  recommendRecordQueryByDgwId: '/cms/app/groupWork/shiFanDian/query', // 查询某党工委示范点
  recommendRecord: '/cms/app/groupWork/recommendRecord/query', // 筑固工程查询最新推荐记录
  honorQuery: '/cms/app/groupWork/honor/query', // 筑固工程示范点支部荣誉分页查询
  newsQuery: '/cms/app/groupWork/news/query', // 筑固工程示范点固本有方分页查询
  // recommendRecordDianZan: '/cms/app/groupWork/recommendRecord/dianZan/', // 对支部进行点赞
  specialList: '/cms/app/news/collection/common/page', // 专题合集
  recommendRecordDianZan: '/cms/app/groupWork/shiFanDian/dianZan/', // 对支部进行点赞
  recommendRecordViews: '/cms/app/groupWork/shiFanDian/views/', // 支部浏览量+1
  play_queryRecommend: '/cms/app/recCloudPlayer/queryRecommend', // 红云播客（APP）-查询视频是否被推荐过
  play_myWatched: '/cms/app/recCloudPlayer/myWatched', // 红云播客（APP）-获取所有关注者的最新视频
  play_recommendPage: '/cms/app/recCloudPlayer/recommendPage', // 红云播客（APP）-红云播客推荐分页数据
  play_areaConfigQuery: '/cms/app/recCloudPlayer/areaConfig/query', // 红云播客（APP）-获取区域数据
  play_mySpaceData: '/cms/app/recCloudPlayer/mySpaceData', // 博客空间的获赞数、关注数、粉丝数
  play_queryShowInAdd: '/cms/app/recCloudPlayer/areaConfig/queryShowInAdd', // 红云播客（APP）-获取区域数据(红云播客添加界面显示的区域)
  play_activityPage: '/cms/app/recCloudPlayer/activity/page', // 红云播客（APP）-获取活动名称分页数据
  play_getContentByActivity: '/cms/app/recCloudPlayer/activity/getContentByActivity', // 红云播客（APP）-获取活动内容分页数据
  getApiIv: '/api-gateway/getApiIv', // 获取秘钥
  //网站
  submitQrCodeKey: '/cms/open/site/login/submitQrCodeKey',//app提交二维码key和用户token
  loginDeviceId: '/api-auth/redis/loginDeviceId/',//获取用户最后一次登录成功的设备ID号


// 商城
  mallCategoryInfoPage: '/mall/app/category/categoryInfoPage', // 分页分类列表信息
  mallProductHotPage: '/mall/app/product/productHotPage', // 热门商品列表
  mallProductHybPage: '/mall/app/product/productHybPage', // 红云办商品查询
  mallProductInfoPage: '/mall/app/product/productInfoPage', // 分页商品列表信息（商户类型）
  mallCreateOrder: '/mall/app/order/createOrder', // 创建订单（立即兑换）
  mallGetProductInfo: '/mall/app/product/getProductInfo/', // 获取商品详情信息
  mallGetProductOrderInfo: '/mall/app/product/getProductOrderInfo', // 获取兑换后的商品详情信息
  mallOrderPage: '/mall/app/order/page', // 获取订单分页数据
  mallOrderYuyue: '/mall/app/order/yuYue', // 提交预约申请
  mallOrderCancelYuyue: '/mall/app/order/cancelYuYue', // 商家未确认前，撤销预约申请。(暂未实现功能)
  mallGetOrdersWithCancel: '/mall/app/order/getOrdersWithCancel', // 获取预约记录有撤销的订单记录
  mallGetOrderDetail: '/mall/web/order/getOrderDetail/', // 获取订单详情
  mallOrderCost: '/mall/app/order/cost', // 消费商品
  mallGetStoreListDto: '/api-user/groupExt/store/listDto', // 综合查询商户
  mallGetStore: '/api-user/groupExt/store/',//通过商户ID查询商户信息
  getCancelByOrder: '/mall/app/order/getCancelByOrder', //根据订单获取撤销记录
  getOrderStatus: '/mall/app/order/getOrderStatus/',//获取订单状态（通过订单id通过订单id,定时器刷用）
  updateYuyueRecord: '/mall/app/order/updateYuyueRecord', //修改预约记录
  // 商家入驻相关
  postConsultInfoList: '/mall/app/consult/postConsultInfoList',//app查询咨询（只能看到自己的）
  postAddConsultInfo: '/mall/app/consult/postAddConsultInfo',//app新增咨询
  postDeleteConsultInfo: '/mall/app/consult/postDeleteConsultInfo/',//app删除咨询
  postUpdateConsultInfo: '/mall/app/consult/postUpdateConsultInfo',//app修改咨询

  //党建教教育培训
  getWsbmList: '/api-user/train/trainClass/getWsbmList',//可网上报名培训列表
  getListByUser: '/api-user/train/trainClass/getListByUser',//用户培训列表
  trainClassDetail: '/api-user/train/trainClass/detail/',//培训班详情
  appBm: '/api-user/train/TrainUserPlan/appBm',//app在线报名

}

function makeApi () {
  if (sessionStorage.dynamicHost && sessionStorage.dynamicHost.indexOf('http') === 0) {
    hostIp = sessionStorage.dynamicHost
    host = hostIp + '/party-center'
  }
  for (let i in api) {
    apiRet[i] = host + api[i]
  }
  for (let i in gatewayApi) {
    // api[i] = hostIp + '/gateway-api' + gatewayApi[i]
    apiRet[i] = hostIp + gatewayApi[i]
  }

  /*http://222.85.156.70:8077/api-file/sysFile  换成 http://222.85.218.15:8078/sysFile*/
// api.downLoadFile = 'http://222.85.218.15:8078/sysFile/download/'
  apiRet.downLoadFile = hostIp + '/api-file/sysFile/download/'
  apiRet.host = hostIp
  apiRet.smartPushApi = smartPushApi
  apiRet.dynamicHost = 'http://djhy.gov.cn:1111/gateway/getGatewayAddress'
}
function testHost(ip){ //测试开发地址ip替换，用于内部测试 2021年1月7日 15:21:28
  for (let i in api) {
    apiRet[i] = ip + api[i]
  }
  for (let i in gatewayApi) {
    apiRet[i] = ip + gatewayApi[i]
  }
  apiRet.downLoadFile = ip + '/api-file/sysFile/download/'
}

testHost(testIp)
apiRet.testHost = testHost
makeApi()
apiRet.makeApi = makeApi

export default apiRet
